﻿#ifndef __SS_INVOKE_INFO_H__
#define __SS_INVOKE_INFO_H__
#include "../ssBaseDefine.h"
#include "../container/stdHashmap.h"
#include <vector>


namespace StarSeeker
{
//调用统计，禁止多线程访问
class ssInvokeInfo
{
public:
	struct InvokeRecord
	{
		u32 id;
		i64 count;
		i64 time;
		i64 vap;//毫秒/次
	};
public:
	ssInvokeInfo();
	//记录频率
	void RecordInfo(u32 id, i64 tsEnd, i64 tsBegin);
	//统计频率
	void ComputeRate();
public:
	bool						m_enableInvokeRecord;
	HASH_MAP<u32, InvokeRecord>	m_invokeInfo;
	i64							m_lastRecordTime;
	std::vector<InvokeRecord>	m_infoOrder;
	InvokeRecord				m_total;
};

}

#endif
